import request from '/@/utils/request';

/**
 * 操作接口
 */
export function useCodeGenApi() {
	return {
		codeGenPageList: (data={}) => {
			return request<any, AjaxResult>({
				url: '/codegen/PageList',
				method: 'post',
				data,
			});
		},
		getApplicationNamespaces: (params?: object) => {
			return request<any, AjaxResult>({
				url: '/codegen/applicationNamespaces',
				method: 'get',
				params,
			});
		},
		deleteCodeGen: (data={}) => {
			return request<any, AjaxResult>({
				url: '/codegen/Delete',
				method: 'post',
				data,
			});
		},
		runLocal: (data={}) => {
			return request<any, AjaxResult>({
				url: '/codegen/runLocal',
				method: 'post',
				data,
			});
		},
		getDbList: (params?:object) => {
			return request<any, AjaxResult>({
				url: '/codegen/DatabaseList',
				method: 'get',
				params,
			});
		},
		getTableListConfigId: (configId:string) => {
			return request<any, AjaxResult>({
				url: '/codegen/TableList/'+configId,
				method: 'get',
				//params,
			});
		},
		postCodeAdd: (data={}) => {
			return request<any, AjaxResult>({
				url: '/codegen/Add',
				method: 'post',
				data,
			});
		},
		postCodeUpdate: (data={}) => {
			return request<any, AjaxResult>({
				url: '/codegen/update',
				method: 'post',
				data,
			});
		},
		getColumnTableNameListConfigId: (tableName: string, configId:string) => {
			return request<any, AjaxResult>({
				url: '/codegen/columnListByTableName/'+tableName+'/'+configId,
				method: 'get',
				//params,
			});
		},
		
		
	};
}
